import React from 'react';
import StateMixin from 'reflux-state-mixin';
import {Table,Input} from 'antd';
import OperAction from 'pages/operator/actions/operAction.js'
import OperStore from 'pages/operator/stores/operStore.js'


export default React.createClass({
  mixins:[StateMixin.connect(OperStore)],
  componentDidMount() {},
  handlePressEnter(event) {
    OperAction.getUsersList(event.target.value)
  },
  _render() {
    const {freeUsers} =  this.state;
    const columns = [{
      title:'姓名',
      dataIndex:'userName',
      key:'userName',
    },{
      title:'邮箱',
      dataIndex:'userEmail',
      key:'userEmail',
    }];

    return (
      <div>
        <div className="user-search-div2" >
          <i className="iconfont icon-sousuo" />
<Input id="userSearch" style={{width:180,paddingLeft:25}} placeholder="请输入关键字" onChange={this.handlePressEnter}/>
          <Table rowKey="userId" columns={columns}  dataSource={freeUsers} />
        </div>
      </div>
    )  
  },
  render() {
    return  this._render() || null;
  }
})
